<template>
	<view class="content">
		<details-person title="个人详情" :list="listData[0]" @getpersonEmity="getpersonEmity"></details-person>
		<view class="box">
			<text class="header-title min">基本情况</text>
			<uni-list :border="false">
				<uni-list-item title="公司" :rightText="enterpriceName" />
				<uni-list-item title="岗位" :rightText="majorName" />
				<uni-list-item title="行业" rightText="软件服务业" />
			</uni-list>
		</view>
		<view class="box" style="margin: 30rpx 0">
			<text class="header-title min">个人荣誉</text>
			<tag type-name="green" :label-data="labelData"></tag>
		</view>
	</view>
</template>

<script setup>
	import detailsPerson from "./components/details-person.vue";
	import VcCardBox from "./components/card.vue";
	import {
		onLoad
	} from "@dcloudio/uni-app";
	import {ref} from "vue";
	import {getEnterprice,getUserInfoList,getUserInfoById} from "@/api/honour/index.js"
	import tag from "./components/tag.vue";
	const listData = ref([]);
	const enterpriceName=ref()
	const majorName=ref()
	const cardData = ref([{
			label: "法定代表人",
			value: "",
			type: "name",
			unit: "",
		},
		{
			label: "注册资本",
			value: "",
			type: "num",
			unit: "万",
		},
		{
			label: "成立日期",
			value: "",
			type: "data",
			unit: "",
		},
		{
			label: "企业规模",
			value: "",
			type: "name",
			unit: "",
		},
		{
			label: "行业类型",
			value: "",
			type: "name",
			unit: "",
		},
		{
			label: "参保员工",
			value: "",
			type: "num",
			unit: "人",
		},
	]);
	const labelData = ref([

	]);
	function getpersonEmity(){

	}
	onLoad((option) => {
		getUserInfoById(option.id).then((res)=>{
			console.log(res)
				enterpriceName.value=res.data.enterpriseName
				majorName.value=res.data.majorName
				let _integral=res.data.integral

					let arr = []
					res.data.userHonorList.map((item)=>{
						labelData.value.push(item.userHonor)
					})
					res.data.badgeList.map((o)=>{
						if(o.badgeName=='爱岗敬业'){
							arr.push({
							url: "https://minio.gzryzl.com/huatai/2024-03-29/1711699648349badgeone.png",
							name: "爱岗敬业",
						})
						}else if(o.badgeName=='行业翘楚'){
							arr.push({
							url: "https://minio.gzryzl.com/huatai/2024-03-29/1711700018494badgetwo.png",
							name: "行业翘楚",
						})
						}else if(o.badgeName=='爱心志愿者'){
							arr.push({
							url: "https://minio.gzryzl.com/huatai/2024-03-29/1711700117886badgethree.png",
							name: "爱心志愿者",
						})
						}else{
							arr.push({
							url: "https://minio.gzryzl.com/huatai/2024-03-20/1710921892815badgefour.png",
							name: "创新发明家",
						})
						}

					listData.value.push({
						name:res.data.nickName,
						integral:_integral,
						label: labelData,
						medal: arr
						})

					})

				})

		})

</script>

<style lang="less" scoped>
	.box {
		.basic {
			font-family: "ali";
			font-weight: 400;
			font-size: @font-size-23;
			color: @color-black;
		}

		.introduce {
			font-family: "ali";
			font-weight: 400;
			font-size: @font-size-23;
			color: @color-label;

		}
	}
</style>
